<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<script src="js/echarts.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/resize.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery-1.10.2.min.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="css/clear.css"/>
		<style type="text/css">
			html,body{
				width:100%;
				height:100%;
			}
		</style>
	</head>
	<body>
		<div class="kss" id="line0" style="width:5.4rem;height:7.3rem;position: absolute;left:0;top:0;margin-top:0.5rem;display: block;background:#fff;"></div>
		<div class="kss" id="column" style="width:5.4rem;height:7.3rem;position: absolute;left:0;top:0;margin-top:0.5rem;display: none;background:#fff;"></div>
	</body>
	<script type="text/javascript">
		window.onload = function(){
			var host = 'http://www.yifutz.net/HKoption/';
			console.log(getUrlVal())
			var stockId = getUrlVal().id;
			var type = getUrlVal().type;
			if(type != 'branchTime'){
				$('#line0').css('display','block')
				$('#column').css('display','none')
				inItEChart (stockId,type)
			}else{
				$('#line0').css('display','none')
				$('#column').css('display','block')
				echart0(stockId,type)
			}
			function getUrlVal() {//获取首页地址上的参数
				var url = window.location.href
		        var Request = new Object();
		        if (url.indexOf("?") != -1) {
		        		var urlindex = url.indexOf("?")+1
		            var str = url.substr(urlindex)
		                　 	var strs = str.split("&");　　
		            for (var i = 0; i < strs.length; i++){　　
		                var tarGets = strs[i].split("=")
		                Request[tarGets[0]] = unescape(tarGets[1]);　　
		            }
		            return Request
		        } else {
		            return Request
		        }
		    };
			var option0 = {
				    backgroundColor: '#fff',
				    legend: {
				        data: ['日K'],
				        inactiveColor: '#777',
				        textStyle: {
				            color: '#666'
				        },
				        type:'scroll',
				        pageTextStyle:{
				        	color:'#fff'
				        },
				        pageIconColor:{
				        	color:'#fff'
				        }
				    },
				    tooltip: {
				        trigger: 'axis',
				        axisPointer: {
				            animation: false,
				            type: 'cross',
				            lineStyle: {
				                color: '#376df4',
				                width: 2,
				                opacity: 1
				            }
				        }
				    },
				    xAxis: {
				        type: 'category',
				        data: [],
				        axisLine: { lineStyle: { color: '#8392A5' } }
				    },
				    yAxis: {
				        scale: true,
				        axisLine: { lineStyle: { color: '#8392A5' } },
				        splitLine: { show: true },
				        offset:-12,
				        nameTextStyle:{fontSize:6}
				    },
				    grid: {
				        bottom: 80
				    },
				    dataZoom: [{
				        textStyle: {
				            color: '#8392A5'
				        },
				        handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
				        handleSize: '80%',
				        dataBackground: {
				            areaStyle: {
				                color: '#8392A5'
				            },
				            lineStyle: {
				                opacity: 0.8,
				                color: '#8392A5'
				            }
				        },
				        handleStyle: {
				            color: '#fff',
				            shadowBlur: 3,
				            shadowColor: 'rgba(0, 0, 0, 0.6)',
				            shadowOffsetX: 2,
				            shadowOffsetY: 2
				        }
				    }, {
				        type: 'inside'
				    }],
				    animation: true,
				    series: [
				        {
				            type: 'candlestick',
//				            type:'line',
				            name: '日K',
//				            data: [],
				            itemStyle: {
				                normal: {
				                    color: '#FD1050',
				                    color0: '#14b143',
				                    borderColor: '#FD1050',
				                    borderColor0: '#14b143'
				                }
				            }
				        }
				    ]
				};
				
			var option1 = {
				    backgroundColor: '#fff',
				    legend: {
				        data: ['周K'],
				        inactiveColor: '#777',
				        textStyle: {
				            color: '#666'
				        },
				        type:'scroll',
				        pageTextStyle:{
				        	color:'#fff'
				        },
				        pageIconColor:{
				        	color:'#fff'
				        }
				    },
				    tooltip: {
				        trigger: 'axis',
				        axisPointer: {
				            animation: false,
				            type: 'cross',
				            lineStyle: {
				                color: '#376df4',
				                width: 2,
				                opacity: 1
				            }
				        }
				    },
				    xAxis: {
				        type: 'category',
				        data: [],
				        axisLine: { lineStyle: { color: '#8392A5' } }
				    },
				    yAxis: {
				        scale: true,
				        axisLine: { lineStyle: { color: '#8392A5' } },
				        splitLine: { show: true },
				        offset:-12,
				        nameTextStyle:{fontSize:6}
				    },
				    grid: {
				        bottom: 80
				    },
				    dataZoom: [{
				        textStyle: {
				            color: '#8392A5'
				        },
				        handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
				        handleSize: '80%',
				        dataBackground: {
				            areaStyle: {
				                color: '#8392A5'
				            },
				            lineStyle: {
				                opacity: 0.8,
				                color: '#8392A5'
				            }
				        },
				        handleStyle: {
				            color: '#fff',
				            shadowBlur: 3,
				            shadowColor: 'rgba(0, 0, 0, 0.6)',
				            shadowOffsetX: 2,
				            shadowOffsetY: 2
				        }
				    }, {
				        type: 'inside'
				    }],
				    animation: true,
				    series: [
				        {
				            type: 'candlestick',
				            name: '周K',
				            data: [],
				            itemStyle: {
				                normal: {
				                    color: '#FD1050',
				                    color0: '#14b143',
				                    borderColor: '#FD1050',
				                    borderColor0: '#14b143'
				                }
				            }
				        }
				    ]
				};
			var option2 = {
				    backgroundColor: '#fff',
				    legend: {
				        data: ['月K'],
				        inactiveColor: '#777',
				        textStyle: {
				            color: '#666'
				        },
				        type:'scroll',
				        pageTextStyle:{
				        	color:'#fff'
				        },
				        pageIconColor:{
				        	color:'#fff'
				        }
				    },
				    tooltip: {
				        trigger: 'axis',
				        axisPointer: {
				            animation: false,
				            type: 'cross',
				            lineStyle: {
				                color: '#376df4',
				                width: 2,
				                opacity: 1
				            }
				        }
				    },
				    xAxis: {
				        type: 'category',
				        data: [],
				        axisLine: { lineStyle: { color: '#8392A5' } }
				    },
				    yAxis: {
				        scale: true,
				        axisLine: { lineStyle: { color: '#8392A5' } },
				        splitLine: { show: true },
				        offset:-12,
				        nameTextStyle:{fontSize:6}
				    },
				    grid: {
				        bottom: 80
				    },
				    dataZoom: [{
				        textStyle: {
				            color: '#8392A5'
				        },
				        handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
				        handleSize: '80%',
				        dataBackground: {
				            areaStyle: {
				                color: '#8392A5'
				            },
				            lineStyle: {
				                opacity: 0.8,
				                color: '#8392A5'
				            }
				        },
				        handleStyle: {
				            color: '#fff',
				            shadowBlur: 3,
				            shadowColor: 'rgba(0, 0, 0, 0.6)',
				            shadowOffsetX: 2,
				            shadowOffsetY: 2
				        }
				    }, {
				        type: 'inside'
				    }],
				    animation: true,
				    series: [
				        {
				            type: 'candlestick',
				            name: '月K',
				            data: [],
				            itemStyle: {
				                normal: {
				                    color: '#FD1050',
				                    color0: '#14b143',
				                    borderColor: '#FD1050',
				                    borderColor0: '#14b143'
				                }
				            }
				        }
				    ]
				};
			var option3 = {
				    backgroundColor: '#fff',
				    legend: {
				        data: ['M5K'],
				        inactiveColor: '#777',
				        textStyle: {
				            color: '#666'
				        },
				        type:'scroll',
				        pageTextStyle:{
				        	color:'#fff'
				        },
				        pageIconColor:{
				        	color:'#fff'
				        }
				    },
				    tooltip: {
				        trigger: 'axis',
				        axisPointer: {
				            animation: false,
				            type: 'cross',
				            lineStyle: {
				                color: '#376df4',
				                width: 2,
				                opacity: 1
				            }
				        }
				    },
				    xAxis: {
				        type: 'category',
				        data: [],
				        axisLine: { lineStyle: { color: '#8392A5' } }
				    },
				    yAxis: {
				        scale: true,
				        axisLine: { lineStyle: { color: '#8392A5' } },
				        splitLine: { show: true },
				        offset:-12,
				        nameTextStyle:{fontSize:6}
				    },
				    grid: {
				        bottom: 80
				    },
				    dataZoom: [{
				        textStyle: {
				            color: '#8392A5'
				        },
				        handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
				        handleSize: '80%',
				        dataBackground: {
				            areaStyle: {
				                color: '#8392A5'
				            },
				            lineStyle: {
				                opacity: 0.8,
				                color: '#8392A5'
				            }
				        },
				        handleStyle: {
				            color: '#fff',
				            shadowBlur: 3,
				            shadowColor: 'rgba(0, 0, 0, 0.6)',
				            shadowOffsetX: 2,
				            shadowOffsetY: 2
				        }
				    }, {
				        type: 'inside'
				    }],
				    animation: true,
				    series: [
				        {
				            type: 'candlestick',
				            name: 'M5K',
				            data: [],
				            itemStyle: {
				                normal: {
				                    color: '#FD1050',
				                    color0: '#14b143',
				                    borderColor: '#FD1050',
				                    borderColor0: '#14b143'
				                }
				            }
				        }
				    ]
				};
			var option4 = {
				    backgroundColor: '#fff',
				    legend: {
				        data: ['M15K'],
				        inactiveColor: '#777',
				        textStyle: {
				            color: '#666'
				        },
				        type:'scroll',
				        pageTextStyle:{
				        	color:'#fff'
				        },
				        pageIconColor:{
				        	color:'#fff'
				        }
				    },
				    tooltip: {
				        trigger: 'axis',
				        axisPointer: {
				            animation: false,
				            type: 'cross',
				            lineStyle: {
				                color: '#376df4',
				                width: 2,
				                opacity: 1
				            }
				        }
				    },
				    xAxis: {
				        type: 'category',
				        data: [],
				        axisLine: { lineStyle: { color: '#8392A5' } }
				    },
				    yAxis: {
				        scale: true,
				        axisLine: { lineStyle: { color: '#8392A5' } },
				        splitLine: { show: true },
				        offset:-12,
				        nameTextStyle:{fontSize:6}
				    },
				    grid: {
				        bottom: 80
				    },
				    dataZoom: [{
				        textStyle: {
				            color: '#8392A5'
				        },
				        handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
				        handleSize: '80%',
				        dataBackground: {
				            areaStyle: {
				                color: '#8392A5'
				            },
				            lineStyle: {
				                opacity: 0.8,
				                color: '#8392A5'
				            }
				        },
				        handleStyle: {
				            color: '#fff',
				            shadowBlur: 3,
				            shadowColor: 'rgba(0, 0, 0, 0.6)',
				            shadowOffsetX: 2,
				            shadowOffsetY: 2
				        }
				    }, {
				        type: 'inside'
				    }],
				    animation: true,
				    series: [
				        {
				            type: 'candlestick',
				            name: 'M15K',
				            data: [],
				            itemStyle: {
				                normal: {
				                    color: '#FD1050',
				                    color0: '#14b143',
				                    borderColor: '#FD1050',
				                    borderColor0: '#14b143'
				                }
				            }
				        }
				    ]
				};
			var option5 = {
				    backgroundColor: '#fff',
				    legend: {
				        data: ['M30K'],
				        inactiveColor: '#777',
				        textStyle: {
				            color: '#666'
				        },
				        type:'scroll',
				        pageTextStyle:{
				        	color:'#fff'
				        },
				        pageIconColor:{
				        	color:'#fff'
				        }
				    },
				    tooltip: {
				        trigger: 'axis',
				        axisPointer: {
				            animation: false,
				            type: 'cross',
				            lineStyle: {
				                color: '#376df4',
				                width: 2,
				                opacity: 1
				            }
				        }
				    },
				    xAxis: {
				        type: 'category',
				        data: [],
				        axisLine: { lineStyle: { color: '#8392A5' } }
				    },
				    yAxis: {
				        scale: true,
				        axisLine: { lineStyle: { color: '#8392A5' } },
				        splitLine: { show: true },
				        offset:-12,
				        nameTextStyle:{fontSize:6}
				    },
				    grid: {
				        bottom: 80
				    },
				    dataZoom: [{
				        textStyle: {
				            color: '#8392A5'
				        },
				        handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
				        handleSize: '80%',
				        dataBackground: {
				            areaStyle: {
				                color: '#8392A5'
				            },
				            lineStyle: {
				                opacity: 0.8,
				                color: '#8392A5'
				            }
				        },
				        handleStyle: {
				            color: '#fff',
				            shadowBlur: 3,
				            shadowColor: 'rgba(0, 0, 0, 0.6)',
				            shadowOffsetX: 2,
				            shadowOffsetY: 2
				        }
				    }, {
				        type: 'inside'
				    }],
				    animation: true,
				    series: [
				        {
				            type: 'candlestick',
				            name: 'M30K',
				            data: [],
				            itemStyle: {
				                normal: {
				                    color: '#FD1050',
				                    color0: '#14b143',
				                    borderColor: '#FD1050',
				                    borderColor0: '#14b143'
				                }
				            }
				        }
				    ]
				};
			var option6 = {
				    backgroundColor: '#fff',
				    legend: {
				        data: ['M60K'],
				        inactiveColor: '#777',
				        textStyle: {
				            color: '#666'
				        },
				        type:'scroll',
				        pageTextStyle:{
				        	color:'#fff'
				        },
				        pageIconColor:{
				        	color:'#fff'
				        }
				    },
				    tooltip: {
				        trigger: 'axis',
				        axisPointer: {
				            animation: false,
				            type: 'cross',
				            lineStyle: {
				                color: '#376df4',
				                width: 2,
				                opacity: 1
				            }
				        }
				    },
				    xAxis: {
				        type: 'category',
				        data: [],
				        axisLine: { lineStyle: { color: '#8392A5' } }
				    },
				    yAxis: {
				        scale: true,
				        axisLine: { lineStyle: { color: '#8392A5' } },
				        splitLine: { show: true },
				        offset:-12,
				        nameTextStyle:{fontSize:6}
				    },
				    grid: {
				        bottom: 80
				    },
				    dataZoom: [{
				        textStyle: {
				            color: '#8392A5'
				        },
				        handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
				        handleSize: '80%',
				        dataBackground: {
				            areaStyle: {
				                color: '#8392A5'
				            },
				            lineStyle: {
				                opacity: 0.8,
				                color: '#8392A5'
				            }
				        },
				        handleStyle: {
				            color: '#fff',
				            shadowBlur: 3,
				            shadowColor: 'rgba(0, 0, 0, 0.6)',
				            shadowOffsetX: 2,
				            shadowOffsetY: 2
				        }
				    }, {
				        type: 'inside'
				    }],
				    animation: true,
				    series: [
				        {
				            type: 'candlestick',
				            name: 'M60K',
				            data: [],
				            itemStyle: {
				                normal: {
				                    color: '#FD1050',
				                    color0: '#14b143',
				                    borderColor: '#FD1050',
				                    borderColor0: '#14b143'
				                }
				            }
				        }
				    ]
				};
				function inItEChart (stockId,type) {//k线图渲染
					var that = this
					$.ajax({
						url:''+host+'/stock/kline',
						type:'POST',
						contentType: 'application/json;charset=utf-8',
						data:JSON.stringify({
						    "stockId" : stockId,
						    "type" : type
						}),
						success:function(res){
//							console.log(res.stockHistoryList)
							if(res.stockHistoryList.length>0){
//								console.log('ok')
							}else{
								alert(res.msg)
								return false
							}
							if(res.stockHistoryList!=null){
								for(var i=0;i<res.stockHistoryList.length;i++){
									res.stockHistoryList[i].updateTime = fmtDate(res.stockHistoryList[i].updateTime)
								}
		//						console.log(res.stockHistoryList)
								var rawData_k = res.stockHistoryList
								var dates = rawData_k.map(function (item) {
		//							console.log(item.updateTime)
								    return item.updateTime;
								})
								var data_k = rawData_k.map(function (item) {
								    return [+item.price, +item.closing, +item.lowest, +item.highest];
								})
								if(type == 'k'){
									option0.xAxis.data = dates
									option0.series[0].data = data_k
									let myChart = echarts.init(document.getElementById('line0'));
									myChart.setOption(option0)
								}else if(type == 'WK'){
									option1.xAxis.data = dates
									option1.series[0].data = data_k
									let myChart = echarts.init(document.getElementById('line0'));
									myChart.setOption(option1)
								}else if(type == 'MK'){
									option2.xAxis.data = dates
									option2.series[0].data = data_k
									let myChart = echarts.init(document.getElementById('line0'));
									myChart.setOption(option2)
								}else if(type == 'M5K'){
									option3.xAxis.data = dates
									option3.series[0].data = data_k
									let myChart = echarts.init(document.getElementById('line0'));
									myChart.setOption(option3)
								}else if(type == 'M15K'){
									option4.xAxis.data = dates
									option4.series[0].data = data_k
									let myChart = echarts.init(document.getElementById('line0'));
									myChart.setOption(option4)
								}else if(type == 'M30K'){
									option5.xAxis.data = dates
									option5.series[0].data = data_k
									let myChart = echarts.init(document.getElementById('line0'));
									myChart.setOption(option5)
								}else if(type == 'M60K'){
									option6.xAxis.data = dates
									option6.series[0].data = data_k
									let myChart = echarts.init(document.getElementById('line0'));
									myChart.setOption(option6)
								}
							}
						}
					})
				};
				function echart0(stockId,type) {//分时图渲染
					var close = [];//现价
					var time = [];//时间（1分钟）
					var volume = [];//成交量
					var average = [];//均价
					var that = this
					$.ajax({
					    url:''+host+'/stock/kline', //请求的url
					    type : "post", 
					    contentType: 'application/json;charset=utf-8',
					    data:JSON.stringify({
						    "stockId" : stockId,
						    "type" : "branchTime"
						}),
					    success : function(data){
							console.log(data);
							var data = data.stockHistoryList
							if(data!=null){
								for(var i = 0; i < data.length; i++) {
									close.push(data[i].closing);
									time.push(formatDate(data[i].updateTime));
									volume.push(data[i].vol);
									average.push(data[i].priceAvg);
								}
						//		console.log(open)
								var startclose = Number(close[0]); //当天开盘价
								console.log(close)
								//y轴刻度
								let close1
								let close2
								let close3
								let close4
								let close5
								let close0
								close1 = startclose - Number((startclose * 0.1).toFixed(2));
								close2 = startclose - Number((startclose * 0.05).toFixed(2));
								close3 = startclose;
								close4 = startclose + Number((startclose * 0.05).toFixed());
								close5 = startclose + Number((startclose * 0.1).toFixed());
								close0 = Number((startclose * 0.05).toFixed(2)); //y轴间隔
		//						console.log(close1,close0,close5)
								function getOption(chartType) {
									var chartOption  = {
										backgroundColor: '#fff',
										legend: {
									        data: ['分时'],
									        inactiveColor: '#777',
									        textStyle: {
									            color: '#fff'
									        },
									        type:'scroll',
									        pageTextStyle:{
									        	color:'#fff'
									        },
									        pageIconColor:{
									        	color:'#fff'
									        }
									    },
										tooltip: {
											trigger: 'axis',
								            axisPointer: {
								                type: 'cross'
								            },
								            backgroundColor: 'rgba(0,0,0,0.6)',
								            padding: 10,
								            textStyle: {
								                color: '#fff'
								            },
								            position: function (pos, params, el, elRect, size) {
								                var obj = {top: 10};
								                obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 30;
								                return obj;
								            },
								            extraCssText: 'width: 150px'
										},
							    dataZoom: [{ 
							        type: 'inside',
							        xAxisIndex: [0, 1],
							        realtime: false,
							        start:50,
							        end:100
						//	        zoomLock:true //关闭缩放 只能平移
							    },{
							    	type: 'inside',
							        xAxisIndex: [0, 1],
							        realtime: false,
						//	        zoomLock:true
							        start:50,
							        end:100
							    }],
						
						
										axisPointer: {
								            link: {xAxisIndex: 'all'},
								            label: {
								                backgroundColor: '#777'
								            }
								        },
										grid: [{
											left: 20, //到左侧的距离
											right: 20, //到右侧的距离
											top: 20, //到顶部的距离
											bottom: '55%' //到底部的距离
										},{
											left: 20, //到左侧的距离
											right: 20, //到右侧的距离
											top: '55%', //到顶部的距离
											bottom: 10 //到底部的距离
										}],	
										calculable: false,
										xAxis: [{
											type: 'category',
											boundaryGap: false,				
											data: time, //x轴数据
											splitLine: {
												lineStyle: {
													type: 'dotted', //solid、dotted、dashed实线点线虚线
													color: '#f2f2f2',
													width: 1,
												}
											},
											axisLabel: { //坐标轴刻度的相关设置
												show: true,
												interval: 239, //控制X轴刻度的显示间隔
												textStyle: {
													color: '#8f8f8f'
												},
											},
											axisLine: { //坐标轴轴线相关设置
							                    lineStyle: {
							                        type: 'solid',
							                        color: '#8f8f8f',//左边线的颜色
							                        width:'1'//坐标线的宽度
							                    }
							                },
							//				axisPointer: {
							//					show: true,
							//					type: 'line',
							//				}
										},{
											type: 'category',
											boundaryGap: false,				
											data: time, //x轴数据
											gridIndex: 1,
											axisLabel: { //坐标轴刻度的相关设置
												show: false,
												interval: 239, //控制X轴刻度的显示间隔
												textStyle: {
													color: '#8f8f8f'
												},
											},
											axisLine: {
							                    lineStyle: {
							                        type: 'solid',
							                        color: '#8f8f8f',//左边线的颜色
							                        width:'1'//坐标线的宽度
							                    }
							                },
							                axisTick:{
							                	show:false
							                }
										}],
										yAxis: [{
						//					type: 'value',
						//					boundaryGap: ['0','100%'],
											axisTick: { show: false },//是否显示刻度线
											axisLabel: { //坐标轴刻度的相关设置
												show: true,	
												inside: true,
												formatter: '{value}\n',
												textStyle: {
												    color: function (value, index) {
												    	if(index==0||index==1){
												    		value = "green"
												    	}
												    	else if(index==2){
												    		value = "#8f8f8f"
												    	}
												    	else if(index==3||index==4){
												    		value = "red"
												    	}					    	
												        return value;
												    }
												},					
											},
											splitLine:{
												show:true
											},
											axisLine: {
							                    lineStyle: {
						//	                        type: 'solid',
							                        color: '#8f8f8f',//左边线的颜色
							                        width:'1'//坐标线的宽度
							                    },
							                    
							        },
							        min:'dataMin',
							        max:'dataMax',
										},{
						//					type:'value',
						//					boundaryGap: ['0','100%'],
											gridIndex: 1,
											axisTick: { show: false },
											axisLabel: {
												inside: true,
												show: true,
												formatter: '{value}\n',
												textStyle: {
													color: '#8f8f8f'
												},				
											},
											axisLine: {
								                lineStyle: {
								                    color: '#8f8f8f',
								                    width: 1
								                }
							            	},
										}],
										series: [{
											name: '成交量',
											barWidth: 7,
											type: 'bar', 
											xAxisIndex: 1,
							        		yAxisIndex: 1,
								//		    symbol:'none', 
											smooth:false, //是否平滑
											data: volume,
											itemStyle: {
										    	  normal: {
											          color: function(params) {
											              var colorList;
											              if (close[params.dataIndex]>close[0]) {
											                  colorList = '#ef232a';
											              } else {
											                  colorList = '#14b143';
											              }
											              return colorList;
											          },
											      }
									        }
										},{
											name: '现价',
											type: chartType, 
							//				symbol:'none', 
											smooth:false, //是否平滑
											data: close,
											itemStyle: { //折线样式
								                normal: {
								                    color: '#2c82cc'
								                }
								            },
							//	            areaStyle: { //折线下方样式
							//	                normal: {
							//	                    color: '#d5e6f5'
							//	                }
							//	            },				
										},{
											name: '均价',
											type: 'line', 
							//				symbol:'none', 
											smooth:false, //是否平滑
											data: average,
											itemStyle: { //折线样式
								                normal: {
								                    color: '#f7e17c'
								                }
								            },	           
										}],
									};
									return chartOption;
								};
								var byId = function(id) {
									return document.getElementById(id);
								};
							}else{
	//							alert(data.msg)
							}
							var lineChart = echarts.init(document.getElementById('column')); //运行
							lineChart.setOption(getOption('line')); //运行
						}
					})
			};
			function fmtDate(time){//时间戳转换年月日
			    var date =  new Date(time);
			    var y = 1900+date.getYear();
			    var m = "0"+(date.getMonth()+1);
			    var d = "0"+date.getDate();
			    return y+"-"+m.substring(m.length-2,m.length)+"-"+d.substring(d.length-2,d.length);
			};
			function formatDate(needTime){//时间戳转换时分
			     //needTime是整数，否则要parseInt转换  
			    var time = new Date(needTime);  
			    var y = time.getFullYear();  
			    var m = time.getMonth()+1;  
			    var d = time.getDate();  
			    var h = time.getHours();  
			    var mm = time.getMinutes();  
			    var s = time.getSeconds();  
//			    return y+'-'+this.add0(m)+'-'+this.add0(d)+' '+this.add0(h)+':'+this.add0(mm);  
			    return add0(h)+':'+add0(mm); 
			};
			function add0(m){
				return m<10?'0'+m:m 
			};
		}
	</script>
</html>
